package org.mj.im.sdk.client.impl;

import org.mj.im.common.enums.IMTerminalType;
import org.mj.im.common.model.IMGroupMessage;
import org.mj.im.common.model.IMPrivateMessage;
import org.mj.im.sdk.client.IMClient;
import org.mj.im.sdk.sender.IMSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;
@Component
public class DefaultIMClient implements IMClient {
    final IMSender sender;

    @Autowired
    public DefaultIMClient(IMSender sender) {
        this.sender = sender;
    }

    @Override
    public <T> void sendPrivateMessage(IMPrivateMessage<T> message) {
        sender.sendPrivateMessage(message);
    }

    @Override
    public <T> void sendGroupMessage(IMGroupMessage<T> message) {
        sender.sendGroupMessage(message);
    }

    @Override
    public Boolean isOnline(Long userId) {
        return sender.isOnline(userId);
    }

    @Override
    public List<Long> getOnlineUserList(List<Long> userIds) {
        return sender.getOnlineUser(userIds);
    }

    @Override
    public Map<Long, List<IMTerminalType>> getOnlineTerminal(List<Long> userIds) {
        return sender.getOnlineTerminal(userIds);
    }
}
